const AndroidSdk = {
  /**
   *  @desc 写日志
   *  @param str 日志内容
   * **/
  writeLog: (str) => {
    try {
      return window.native.handleMessage(
        JSON.stringify({
          action: 'WebLogAction',
          callback: '',
          data: str
        })
      );
    } catch (e) {
      console.log(e.message);
    }
  },
  /**
   * @desc 设备信息
   * **/
  deviceInfoAction(jsonstr) {
    try {
      return window.native.handleMessage(jsonstr);
    } catch (e) {
      console.log(e.message);
    }
  },
  queueSwitchAction() {
    try {
      return window.native.handleMessage({
        action: 'QueueSwitchAction',
        callback: '',
        data: ''
      });
    } catch (e) {
      console.log(e.message);
    }
  }
};

export default AndroidSdk;
